﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kooboo.IoC;


namespace Kooboo.Commerce.Services
{
    public abstract class ServiceBase<TRepository, TEntity> : IService where TRepository : IEntityRepository
    {
        TRepository _Repository;
        public TRepository Repository
        {
            get
            {
                if (this._Repository == null)
                {
                    this._Repository = ContextContainer.Current.Resolve<TRepository>();
                }

                return this._Repository;
            }
        }


        public abstract IQueryable<TEntity> QueryService
        {
            get;
        }
    }
}
